package com.wang.designpattern.builder.improve;

/**
 * 指挥者，聚合建造者
 * 控制建造者的执行流程
 */
public class HouseDirector {

    IBuilder builder;

    public HouseDirector() {
    }

    public HouseDirector(IBuilder builder) {
        this.builder = builder;
    }

    public IBuilder getBuilder() {
        return builder;
    }


    public void setBuilder(IBuilder builder) {
        this.builder = builder;
    }

    public House construct() {
        builder.buildBasic();
        builder.buildWalls();
        builder.buildRoof();
        return builder.getResult();
    }

}
